package top.hcode.hoj.dao.course;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import top.hcode.hoj.mapper.LessonWorkQuestionMapper;
import top.hcode.hoj.pojo.entity.course.LessonWorkQuestion;

/**
 * @author orangej
 * @since 2024/12/18
 */
@Service
public class LessonWorkQuestionDao extends ServiceImpl<LessonWorkQuestionMapper, LessonWorkQuestion> {

    public Integer nextSortOrder(Long lessonId, String workType) {
        Integer max = baseMapper.getNextSortOrder(lessonId, workType);
        return max == null ? 1 : max + 1;
    }
}
